-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IS-11] Make test cases independent #836
[IS-11] Make test cases independent #836
Conversation
Libraries like python-zeroconf are starting to depend on more recent Python features
python-zeroconf 0.75.0 strict=False for _nmos-registration._tcp
So that same one is used by Python tests and testssl.sh tests Co-authored-by: Simon Lo <simon.lo@sony.com>
Co-authored-by: Simon Lo <simon.lo@sony.com>
Co-authored-by: jonathan-r-thorpe <64410119+jonathan-r-thorpe@users.noreply.github.com>
Pass IP address of API under test to testssl.sh
Mocks warm up
Tests of Outputs:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments
data=VALID_EDID) | ||
if not valid or response.status_code != 204: | ||
return test.FAIL("Unexpected response from " | ||
"the Stream Compatibility Management API: {}".format(response)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add reasonable delay after put command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code PUTs and then immediately GETs /edid/base
. It's clear that handling the new EDID by an external baseband source takes some time but the API is the matter of the Node, and the spec doesn't allow the following situation:
- value is ABC
- user sets it to CBA
- user requests it and gets ABC
- user waits some time
- user requests it again and gets CBA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1f83676
valid, response = self.do_request("DELETE", self.compat_url + "inputs/" + inputId + "/edid/base") | ||
if not valid or response.status_code != 204: | ||
return test.FAIL("Unexpected response from " | ||
"the Stream Compatibility Management API: {}".format(response)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add reasonable delay after Delete command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same case as #836 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1f83676
nmostesting/suites/IS1101Test.py
Outdated
valid, response = self.do_request("PUT", | ||
self.compat_url + "inputs/" + inputId + "/edid/base", | ||
headers={"Content-Type": "application/octet-stream"}, | ||
data=VALID_EDID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add reasonable delay after Put command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version of an Input should increment immediately after a PUT, isn't it?
if not valid or response.status_code != 405: | ||
return test.FAIL("Unexpected response " | ||
"for DELETE /edid/base: {}".format(response)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add reasonable delay after Delete command.
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We expect that a Node rejects the request, why should we wait here?
valid, response = self.do_request("GET", self.compat_url + "inputs/" + inputId + "/edid/base") | ||
if not valid or response.status_code != 204: | ||
return test.FAIL("Unexpected response from " | ||
"the Stream Compatibility Management API: {}".format(response)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add reasonable delay after Delete command before getting the effective EDID
start_time = time.time()
while time.time() < start_time + CONFIG.API_PROCESSING_TIMEOUT:
time.sleep(0.2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 1f83676
# Conflicts: # nmostesting/IS11Utils.py
Let's merge this PR in is-11 |
This PR unifies IS-11 test suite with the rest in terms of test cases independence.
The first reworked part is tests of Inputs:
test_1
deactivate_connection_resources
called inset_up_tests
delete_active_constraints
called inset_up_tests
set_up_tests
set_up_tests
test_2
test_3
test_4
test_5
test_6